<!DOCTYPE html>

<html lang="it"  class="dashboard">

    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

        <title>Eventi Jesolo 2013 - Movimento Giovanile Salesiano</title>

        <link rel="stylesheet" href="<?= Site::APP_URL ?>bootstrap/css/bootstrap.min.css" />
        <link rel="stylesheet" href="<?= Site::APP_URL ?>css/base.css" />
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/md5.js"></script>
        <script src="<?= Site::APP_URL ?>js/jwerty-setup.js"></script>
        <script>
            $(document).ready(function() {
                $('#submit-btn').click(function(){
                    var login_form = $('#login-form');
                    var usr_input = login_form.find('#username');
                    var pwd_input = login_form.find('#password');
                    if (usr_input.val() != '' && pwd_input.val() != '') {
                        var md5 = CryptoJS.MD5(pwd_input.val());
                        pwd_input.val(md5);
                        return true;
                    }
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <!-- Page Layout HTML here -->
        <div class="container">
            <div class="row">
                <div class="span12">
                    <form id="login-form" class="form-horizontal login-page" method="POST" action="/eventijesolo/login/">
                        <legend>Eventi Jesolo :: donboscoland.it</legend>
                        <div class="control-group <?= (isset($_SESSION['login_error']) && ($_SESSION['login_error'] == 1)) ? 'error' : '' ?>">
                            <label class="control-label" for="username">Username</label>
                            <div class="controls">
                                <input type="text" id="username" placeholder="Username" name="username" />
                                <?php 
                                    if (isset($_SESSION['login_error']) && ($_SESSION['login_error'] == 1)) { ?>
                                        <span class="help-inline">Username inesistente.</span>
                                <?php
                                    }
                                ?>
                            </div>
                        </div>
                        <div class="control-group <?= (isset($_SESSION['login_error']) && ($_SESSION['login_error'] == 1)) ? 'error' : '' ?>">
                            <label class="control-label" for="password">Password</label>
                            <div class="controls">
                                <input type="password" id="password" placeholder="Password" name="password" />
                                <?php 
                                    if (isset($_SESSION['login_error']) && ($_SESSION['login_error'] == 1)) { ?>
                                        <span class="help-inline">Password errata.</span>
                                <?php
                                    }
                                ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <label class="checkbox">
                                    <input type="checkbox" name="remember-me" checked="checked" /> Ricordami
                                </label>
                                <button type="submit" id="submit-btn" class="btn btn-primary" name="submit">Login</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- Initialize JS Plugins -->
        <script src="bootstrap/js/bootstrap.min.js"></script>
        <script src="js/retina.js"></script>
    </body>
</html>
